import time

import pytest
from selenium import webdriver
from base.Base import Base
from page.Page import Page

@pytest.fixture(scope='class')
def driver():
    driver = webdriver.Edge()
    driver.get("https://www.baidu.com/")
    driver.maximize_window()
    driver.implicitly_wait(10)
    yield driver
    time.sleep(2)
    driver.quit()

def test_search(driver):
    po = Page(driver)
    dy1 = po.get_search_text()
    print(dy1)
    assert dy1 == "百度一下"
    po.send_search()
    po.click_search_botton()
    time.sleep(2)
    dy2 = po.get_one_text()
    print(dy2)
    assert "我喜欢软件测试" in po.get_one_text()
    time.sleep(2)
    po.goto_tow()
    time.sleep(2)
    print(po.get_tow_text())
    time.sleep(2)





